<%@ page language="java" import="java.util.*,entity.*,dao.*,dao.impl.*" pageEncoding="UTF-8"%>
<%
  request.setCharacterEncoding("utf-8");
  String userName = request.getParameter("uname");
  String userPass = request.getParameter("upass");
  String head = request.getParameter("head");
  
  int gender = Integer.parseInt(request.getParameter("gender"));
  
  UserDao userDao = new UserDaoImpl();
  
  User user = new User();
  user.setUserName(userName);
  user.setUserPass(userPass);
  user.setHead(head);
  user.setGender(gender);
  
  int num = userDao.addUser(user);
  if(num==1){
  	response.sendRedirect("../index.jsp");
  }else{
  	response.sendRedirect("../reg.jsp");
  }
%>